data SEGMENT
    result db "NO MATCH$"
    string1 db 16 dup(?)
data ENDS
code SEGMENT
    assume cs:code, ds:data
start:
    mov ax, data
    mov ds, ax
    mov ah, 1
    lea di, string1
    input1:
        int 21h
        mov [di], al
        inc di
        cmp al, 13
        jnz input1
    mov cx, 3
    lea di, string1
    input2:
        int 21h
        cmp al, [di]
        jz equal
        mov cx, 0
        equal:
            cmp al, 13
            jz output
            inc di
            jmp input2
    output:
        lea dx, result
        add dx, cx
        mov ah, 9
        int 21h
    mov ah, 4ch
    int 21h
code ENDS
end start